﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace HZYProject.Domain
{
    public class Question
    {
        /// <summary>
        /// 问题编号
        /// </summary>
        [Key]
        public Guid QuestionID { get; set; }

        /// <summary>
        /// 问题题干
        /// </summary>
        [StringLength(400)]
        public string Title { get; set; }

        /// <summary>
        /// 所属章节编号
        /// </summary>
        public Guid ChapterID { get; set; }

        /// <summary>
        /// 所属课程编号
        /// </summary>
        public Guid CourseID { get; set; }

        /// <summary>
        /// 题目类型
        /// </summary>
        public TypeName TypeName { get; set; }

        /// <summary>
        /// 题目分数
        /// </summary>
        public decimal Score { get; set; }

        /// <summary>
        /// 题目解析
        /// </summary>
        public string Content { get; set; }


        /// <summary>
        /// 答案-除判断题外都以Json格式存储，判断题直接存T|F
        /// </summary>
        public string Option { get; set; }

        [NotMapped]
        public List<Option> Options { get; set; }
        /// <summary>
        /// 导航属性-所属章节
        /// </summary>
        public virtual Chapter Chapter { get; set; }
        /// <summary>
        /// 导航属性-所属课程
        /// </summary>
        public virtual Course Course { get; set; }
    }

    public enum TypeName
    {
        [Display(Name = "单选题")]
        Radio = 1,
        [Display(Name = "多选题")]
        CheckBox = 2,
        [Display(Name = "填空题")]
        Fill = 3,
        [Display(Name = "判断题")]
        TorF = 4,
        [Display(Name = "拖拽题")]
        Drag = 5,
        [Display(Name = "排序题")]
        Sort = 6


    }
}
